G_DECLARE_FINAL_TYPE was introduced in glib 2.44.
We shall use that now so that lots of boilerplate code can
be reduced.
https://bugzilla.gnome.org/show_bug.cgi?id=770278
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW);
static void
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkDialog parent;
};
-struct _ExampleAppPrefsClass
-{
- GtkDialogClass parent_class;
-};
-
typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
struct _ExampleAppPrefsPrivate
#define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
-typedef struct _ExampleAppPrefs ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass;
-
-
-GType example_app_prefs_get_type (void);
ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct _ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW);
static void
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct _ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct _ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct _ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
#include "exampleappwin.h"
#include "exampleappprefs.h"
-struct ExampleApp
+struct _ExampleApp
{
GtkApplication parent;
};
-struct ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct ExampleApp ExampleApp;
-typedef struct ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkDialog parent;
};
-struct _ExampleAppPrefsClass
-{
- GtkDialogClass parent_class;
-};
-
typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
struct _ExampleAppPrefsPrivate
#define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
-typedef struct _ExampleAppPrefs ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass;
-
-
-GType example_app_prefs_get_type (void);
ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win);
#include "exampleapp.h"
#include "exampleappwin.h"
-struct ExampleAppWindow
+struct _ExampleAppWindow
{
GtkApplicationWindow parent;
};
-struct ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct ExampleAppWindow ExampleAppWindow;
-typedef struct ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkDialog parent;
};
-struct _ExampleAppPrefsClass
-{
- GtkDialogClass parent_class;
-};
-
typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
struct _ExampleAppPrefsPrivate
#define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
-typedef struct _ExampleAppPrefs ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass;
-
-
-GType example_app_prefs_get_type (void);
ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct _ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkDialog parent;
};
-struct _ExampleAppPrefsClass
-{
- GtkDialogClass parent_class;
-};
-
typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
struct _ExampleAppPrefsPrivate
#define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
-typedef struct _ExampleAppPrefs ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass;
-
-
-GType example_app_prefs_get_type (void);
ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct _ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);
GtkApplication parent;
};
-struct _ExampleAppClass
-{
- GtkApplicationClass parent_class;
-};
-
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
static void
#define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
-typedef struct _ExampleApp ExampleApp;
-typedef struct _ExampleAppClass ExampleAppClass;
-
-
-GType example_app_get_type (void);
ExampleApp *example_app_new (void);
GtkDialog parent;
};
-struct _ExampleAppPrefsClass
-{
- GtkDialogClass parent_class;
-};
-
typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
struct _ExampleAppPrefsPrivate
#define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
-typedef struct _ExampleAppPrefs ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass ExampleAppPrefsClass;
-
-
-GType example_app_prefs_get_type (void);
ExampleAppPrefs *example_app_prefs_new (ExampleAppWindow *win);
GtkApplicationWindow parent;
};
-struct _ExampleAppWindowClass
-{
- GtkApplicationWindowClass parent_class;
-};
-
typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
struct _ExampleAppWindowPrivate
#define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
-typedef struct _ExampleAppWindow ExampleAppWindow;
-typedef struct _ExampleAppWindowClass ExampleAppWindowClass;
-
-
-GType example_app_window_get_type (void);
ExampleAppWindow *example_app_window_new (ExampleApp *app);
void example_app_window_open (ExampleAppWindow *win,
GFile *file);